import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LoginData, TokenResult, VerifyCode } from './types';


/**
 * 获取验证码
 */
export function getCaptchaApi(data:string) {
  return request({
    url: `/open/captcha/images/${data}`,
    method: 'get'
  });
}

/**
 * 登录
 */
export function loginApi(form: LoginData) {
  return request({
    url: 'open/auth/token',
    method: 'post',
    data: form
  });
}

/**
 * 注销
 */
export function logoutApi() {
  return request({
    url: '/api/v1/auth/logout',
    method: 'delete'
  });
}
